/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: ExceptionUtil
 * Author:   zhouheng
 * Date:     2019/5/14 22:55
 * Description: 异常工具类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.star.pay.exception;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.dubbo.user.api.constants.ResponseCodeEnum;

/**
 * 〈一句话功能简述〉<br> 
 * 〈异常工具类〉
 *
 * @author zhouheng
 * @create 2019/5/14
 * @since 1.0.0
 */
public class ExceptionUtil {
    private static Logger logger = LoggerFactory.getLogger(ExceptionUtil.class);

    /**
     * 将下层抛出的异常转换为resp返回码
     *
     * @param e Exception
     * @return
     */
    public static Exception handlerException4biz(Exception e) {
        Exception ex = null;

        if (!(e instanceof Exception)) {
            return null;
        }
        if (e instanceof ValidateException){
//            ex = new ServiceException(e.)
        }
        if (e instanceof ServiceException){

        }

        logger.error("ExceptionUtil.handlerException4biz,Exception=" + e.getMessage(), e);

        return ex;
    }
}